#version 330 core
out vec4 FragColor;

in float TexCoord;

// 注意不能使用和标准函数同名的变量
// uniform sampler1D texture;
uniform sampler1D tex;
uniform vec4 color;
uniform int enableTex;

void main()
{
    if (enableTex == 1)
        FragColor = texture(tex, TexCoord);
    else
        FragColor = color;
}